package com.itheima.web.order.controller;

import com.itheima.order.feign.OrderFeign;
import com.itheima.order.feign.OrderFeignDemo;
import com.itheima.order.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("worderDemo")
public class WebOrderControllerDemo {

    @Autowired
    OrderFeignDemo orderFeignDemo;

    @GetMapping("/getToken")
    public String getToken(){
        return orderFeignDemo.getToken();
    }

    //添加订单操作
    @PostMapping("/addOrder")
    public String addOrder(@RequestBody Order order){
       return orderFeignDemo.addOrder(order);
    }

}
